<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>发布文章</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    
    <link rel="stylesheet" href="__HOME__/css/weui.css">
    <link rel="stylesheet" href="__HOME__/css/jquery-weui.css">
    <link rel="stylesheet" href="__HOME__/css/style.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_729135_t2loq20h12.css">
    
    <script src="__HOME__/js/jquery.min.js"></script>
    <script src="__HOME__/js/jquery-weui.min.js"></script>
   
    <style>
    
    </style>
</head>
<body class="back1">    
    <div class="index-top-fix">
        <a href="{:url('store/teacher.index/mycenter')}?shop_id={$shop_id}" class="iconfont icon-left- left"></a>
        <p class="title">发布文章</p>
    </div>
    <div class="mt50"></div>
    <div style="width: 80%;margin: 0 auto;background-color: #fff;height: 200px;box-shadow:0px 0px  10px 5px #D2D2D2;">
            <div class="weui-media-box weui-media-box_text" style="color: grey">
                <h4 class="weui-media-box__title">请在电脑端打开此链接进行编辑</h4>
            </div>
        <div style="text-align: center;margin-top: 10px;word-break: break-all;word-wrap: break-word">{$url}</div>
    </div>
    <div onclick="weixin_qr()" style="height: 50px;background: #FE8200 ;width: 80%;margin: 10px auto;box-shadow:0px 0px  10px 5px #D2D2D2;text-align: center">
            <img    style="width: 35px;height: 35px;margin-top: 8px"  src="__HOME__/images/sys1.png">
            <span style="width: 75%;float: right;color: white;font-size: 13px;margin-top: 15px"> 点我扫一扫哦</span>
    </div>

</body>
<script src="__HOME__/js/jweixin-1.2.0.js"></script>
<script>
    //微信扫一扫
    wx.config({
        debug: false,
        appId: '{$jsconfig.appId}',
        timestamp: '{$jsconfig.timestamp}',
        nonceStr: '{$jsconfig.noncestr}',
        signature: '{$jsconfig.signature}',
        jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard'
        ]
    });
    wx.isInit = false;

    wx.ready(function () {



    });
    //微信扫描编号放input框
    // function weixin_qr() {
    //     wx.scanQRCode({
    //         needResult: 1,
    //         desc: 'scanQRCode desc',
    //         success: function (res) {
    //             // alert(JSON.stringify(res));
    //             var pc_token = res.resultStr;
    //             console.log(result);
    //             var inp = $('#ma').val(result);
    //
    //         }
    //     });
    // }
    function weixin_qr() {
        wx.scanQRCode({
            desc: 'scanQRCode desc',
            needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
            success: function (res) {
                var data = res.resultStr;
                console.log(data+'123');
                    $.post("{:url('/store/teacher.article/inset_code')}?shop_id={$shop_id}",{data:data},function (res) {
                        console.log(res);
                        if(res.code==1){
                        }
                        else{
                            $.alert(res.msg,function () {
                                return false;
                            })
                        }
                    })
            }
        });
    }


    wx.error(function (res) {
//        alert(res.errMsg);
    });
</script>
</html>

